package StreamDemo;

import java.util.stream.Stream;

/**
 * @Author: ylc
 * @Description:  static <T> Stream<T> concat(Stream<? extends T> a, Stream<? extends T> b)
 *      用于把流组合到一起
 * @Date Created in 2022-05-05 20:32
 */
public class Demo8_concat {
    public static void main(String[] args) {
        Stream<String> stream1 = Stream.of("叶凡", "张三", "赵云", "张飞");
        Stream<String> stream2 = Stream.of("阿尔托莉雅","阿铭","卡伦","艾伦");

        Stream<String> concat = Stream.concat(stream1, stream2);
        //遍历concat流
        concat.forEach(name-> System.out.println(name));
    }
}
